package com.lemon.redis.properties;

import com.lemon.core.factory.YamlPropertySourceFactory;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author 李猛
 * @datetime 2024/2/15 22:54
 * @description 类对象
 */
@Getter
@Setter
@Component
@PropertySource(value = "classpath:redis-config.yml", factory = YamlPropertySourceFactory.class)
@ConfigurationProperties(prefix = "redis")
public class RedisConfigProperties {
    //Redis连接地址
    private String host;
    //Redis连接端口号
    private int port;
    //Redis密码
    private String password;
    //Redis连接数据库索引，默认为0
    private int database;
    //Redis最大连接数
    private int maxActive;
    //Redis最大空闲连接数
    private int maxIdle;
    //Redis最大等待时间
    private int maxWait;
    //Redis总连接数的最大值
    private int maxTotal;
    //Redis最小空闲连接数
    private int minIdle;
    //Redis连接超时时间
    private int timeout;
    //Redis过期时间
    private int expire;
}
